<!DOCTYPE html>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>
<%@ include file="../core/core.jsp" %>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>修改商品</title>
    <meta name="keywords" content="叮当猫">
    <meta name="description" content="叮当猫">
    <link href="../static/css/summernote.css" rel="stylesheet">
    <link href="../static/css/summernote-bs3.css" rel="stylesheet">
    <link href="../static/css/cropper.min.css" rel="stylesheet">
    <link href="../static/css/sitelogo.css" rel="stylesheet">
    <link rel="stylesheet" href="../static/css/artEditor.css">
    <link rel="stylesheet" href="../static/zyupload/skins/zyupload-1.0.0.min.css " type="text/css">
<%-- <script type="text/javascript" src="../static/zyupload/jquery-1.7.2.js"></script>--%>
    <script type="text/javascript" src="../static/zyupload/zyupload.drag-1.0.0.min.js"></script>
    <script src="../static/js/photoClip/cropper.js"></script>
    <script src="../static/js/photoClip/sitelogo.js"></script>
    <style>
        #clipArea {
            margin: 20px;
            height: 300px;
        }

        #file,
        #clipBtn {
            margin: 20px;
        }

        #view {
            margin: 0 auto;
            width: 200px;
            height: 200px;
        }

        table.dataTable thead .sorting:after {
            content: '';
        }

        .editDetail, #editState, #keepState, #editInventory, #saveInventory, .editAll {
            background-color: #49c9bb;
            color: #FFFFFF;
            display: inline-block;
            padding: 6px 12px;
            font-size: 14px;
            font-weight: 400;
            line-height: 1.42857143;
            text-align: center;
            vertical-align: middle;
            cursor: pointer;
            border-radius: 4px;
            margin-top: 10px;
            white-space: nowrap;
        }

        #editState, #keepState, #editInventory, #saveInventory {
            margin-top: 0;
        }

        .spe_title input, .spe_detail input {
            margin-right: 27px;
            margin-bottom: 10px;
        }

        .spe_title img {
            position: absolute;
            top: -10px;
            right: -11px;
            width: 24px;
            height: 24px;
        }

        .spe_detail img {
            position: absolute;
            top: -10px;
            right: 12px;
            width: 24px;
            height: 24px;
        }

        input[type=checkbox] {
            width: 18px;
            height: 18px;
            margin: 0 20px 0 4px;
            vertical-align: middle;
        }
        .delItem{
            cursor: pointer;
            text-decoration: underline;
        }
        .oneImgBox,.oneImgBox2{
            position: relative;
            width: 80px;
            height: 66px;
            margin-right: 10px;
            float: left;
        }
        .oneImgBox img,.oneImgBox2 img{
            width: 66px;
            height: 66px;
            display: block;
        }
        .oneImgBox span,.oneImgBox2 span{
            width: 18px;
            height: 18px;
            font-size: 18px;
            line-height: 18px;
            position: absolute;
            top:0;
            right: 0;
            cursor: pointer;
        }
    </style>
</head>

<body>
<%--
<div class="btn btn-primary" style="margin: 21px 0 0 48px;" id="editAll">修改商品信息</div>

<div class="btn btn-primary" style="margin: 21px 0 0 15px;display: none;" id="addSpe" data-toggle="modal" data-target="#avatar-modal6">添加规格信息</div>
<div class="btn btn-primary" style="margin: 21px 0 0 15px;display: none;" id="editSpe" data-toggle="modal" data-target="#avatar-modal7">修改规格信息</div>
--%>
<div class="wrapper wrapper-content animated fadeInRight">
    <div id="idBox" style="display: none;"><%=request.getAttribute("id")%></div>
    <div class="ibox-content">
        <form class="form-horizontal m-t" id="commentForm">
            <div class="form-group">
                <label class="col-sm-1 control-label">商品名称：</label>
                <div class="col-sm-8">
                    <input id="name" name="name" type="text" class="form-control" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">商品描述：</label>
                <div class="col-sm-8">
                    <input id="sumary" type="text" class="form-control" name="email" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">商品库存：</label>
                <div class="col-sm-8">
                    <input id="inventory" type="text" class="form-control" name="email" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">商品单价：</label>
                <div class="col-sm-8">
                    <input id="unitIntegral" type="text" class="form-control" name="email" >
                </div>
            </div>

            <div class="form-group" id="totalIntegralHiden">
                <label class="col-sm-1 control-label">商品份数：</label>
                <div class="col-sm-8">
                    <input id="totalIntegral" type="text" class="form-control" name="email" >
                </div>
            </div>

            <div class="form-group" >
                <label class="col-sm-1 control-label">商品类型：</label>
                <div class="col-sm-8">
                    <select name="" id="goodsTypeValue" style="width: 100%;height: 34px;" readonly disabled>
                        <option value="1">积分兑换</option>
                        <option value="2">积分抽奖</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-1 control-label">商品状态：</label>
                <div class="col-sm-8">
                    <select name="" id="stateValue" style="width: 100%;height: 34px;" readonly>
                        <option value="0">无效</option>
                        <option value="1">有效</option>
                    </select>
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-1 control-label">商品主图：</label>
                <div class="col-sm-8">
                    <div id="imgBox">
                        <%--<img id="mainImg" src="../static/img/uploadImg.png" alt="img" style="width: 66px;height: 66px;">--%>
                    </div>
                    <button id="update" type="button" class="btn btn-primary" data-toggle="modal"
                            data-target="#avatar-modal" style="margin-bottom: 0px;margin-left: 15px;display: none;">
                        上传商品主图
                    </button>
                    <%--<div class="user_pic" style="margin: 0px;">--%>
                        <%--<img src=""/>--%>
                    <%--</div>--%>
                    <span>（大小为750*750）</span>
                </div>
            </div>
            <div class="form-group" id="detailBox">
                <label class="col-sm-1 control-label">商品图文详情：</label>
                <div class="publish-article-content col-sm-8">
                    <!-- 加载编辑器的容器 -->
                    <script id="container" name="content" type="text/plain">
                    </script>

                </div>
            </div>
        </form>

        <div class="btn btn-primary" style="margin-left: 116px" id="save2">修改商品</div>
    </div>


</div>



<%--<button type="button" class="btn btn-success" data-toggle="modal" data-target="#ggModal">添加规格</button>--%>



<!--sfy添加规格模态框 -->
<div class="modal fade" id="ggModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
     style="margin-top: 500px">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">添加规格</h4>
            </div>
            <div class="modal-body">

                <div class="form-group">
                    <label for="ggname">名称</label>
                    <input type="text" class="form-control" id="ggname" placeholder="例如：尺寸">
                </div>


                <button class="btn btn-info" id="ggsubmit">提交</button>

            </div>

        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>



<div class="modal fade" id="avatar-modal" aria-hidden="true" aria-labelledby="avatar-modal-label" role="dialog"
     tabindex="-1">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 655px;height: 705px">

                <div class="modal-header">
                    <button class="close" data-dismiss="modal" type="button">&times;</button>
                    <h4 class="modal-title" id="avatar-modal-label">上传图片</h4>
                </div>

      <div id="zyupload" class="zyupload"></div>

      <script type="text/javascript">;
      var mainImageUrlAll ='';
      $(function(){
              // 初始化插件
              $("#zyupload").zyUpload({
                  width            :   "650px",                 // 宽度
                  height           :   "400px",                 // 宽度
                  itemWidth        :   "140px",                 // 文件项的宽度
                  itemHeight       :   "115px",                 // 文件项的高度
                  url              :   "/crm/uploadImage.do",  // 上传文件的路径
                  fileType         :   ["jpg","png","js","exe"],// 上传文件的类型
                  fileSize         :   51200000,                // 上传文件的大小
                  multiple         :   true,                    // 是否可以多个文件上传
                  dragDrop         :   true,                    // 是否可以拖动上传文件
                  tailor           :   false,                    // 是否可以裁剪图片
                  del              :   true,                    // 是否可以删除文件
                  finishDel        :   false,  				  // 是否在上传文件完成后删除预览
                  /* 外部获得的回调接口 */
                  onSelect: function(selectFiles, allFiles){    // 选择文件的回调方法  selectFile:当前选中的文件  allFiles:还没上传的全部文件
                      console.info("当前选择了以下文件：");
                      console.info(selectFiles);
                  },
                  onDelete: function(file, files){              // 删除一个文件的回调方法 file:当前删除的文件  files:删除之后的文件
                      console.info("当前删除了此文件：");
                      console.info(file.name);
                  },
                  onSuccess: function(file, response){// 文件上传成功的回调方法
                      console.info("此文件上传成功：");
                      console.info(file.name);
                      console.info("此文件上传到服务器地址：");
                      console.info(response);
                      var args = response.split("|");
                      mainImageUrlAll+=args[1]+",";
                      //铺出来上传成功后的图片
                      if(ifSpeImg=='false'){
                          $('#imgBox').append(
                              '<div class="oneImgBox"><img  src="'+args[1]+'" alt="img" ifShow="true" style="width: 66px;height: 66px;"><span>×</span></div>'
                          );
                      }else{
                          $('#imgBox2').empty();
                          $('#imgBox2').append('<div class="oneImgBox2"><img id="mainImg2" src="'+args[1]+'" alt="img" style="width: 66px;height: 66px;"><span class="del">×</span></div>')
                      }
                      $("#uploadInf").append("<p>上传成功，文件地址是：" + response + "</p>");
                  },
                  onFailure: function(file, response){          // 文件上传失败的回调方法
                      console.info("此文件上传失败：");
                      console.info(file.name);
                  },
                  onComplete: function(response){           	  // 上传完成的回调方法
                      console.info("文件上传完成");
                      console.info(response);
                  }
              });

          });

      </script>



    </div>
        </div>
</div>
<div class="loading" aria-label="Loading" role="img" tabindex="-1"></div>

<script src="../static/js/ajaxfileupload_v1.js"></script>
<script src="../static/js/photoClip/html2canvas.min.js" type="text/javascript" charset="utf-8"></script>
<!-- SUMMERNOTE -->
<script src="../static/js/plugins/summernote.min.js"></script>
<script src="../static/js/plugins/summernote-zh-CN.js"></script>
<script>
    $(document).ready(function () {

        $('.summernote').summernote({
            lang: 'zh-CN'
        });

    });
    var edit = function () {
        $("#eg").addClass("no-padding");
        $('.click2edit').summernote({
            lang: 'zh-CN',
            focus: true
        });
    };
    var save = function () {
        $("#eg").removeClass("no-padding");
        var aHTML = $('.click2edit').code(); //save HTML If you need(aHTML: array).
        $('.click2edit').destroy();
    };
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="../static/js/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="../static/js/ueditor/ueditor.all.min.js"></script>
<script src="../static/js/integralGoods/details.js" charset="utf-8"></script>
<script>

</script>
</body>

</html>
